import express from 'express';
import NoticeboardController from '../controller/noticeboardCtrl.js';

const router = express.Router();

// Post management routes
router.get('/posts/page/:page', NoticeboardController.getList);
router.get('/posts/:id', NoticeboardController.getById);
router.post('/posts', NoticeboardController.create);
router.put('/posts/:id', NoticeboardController.update);
router.delete('/posts/:id', NoticeboardController.delete);

// Post interaction routes
router.post('/posts/:id/like', NoticeboardController.like);
router.get('/posts/:id/comments', NoticeboardController.getComments);
router.post('/posts/:id/comments', NoticeboardController.addComment);
router.delete('/posts/:postId/comments/:commentId', NoticeboardController.deleteComment);

export default router;